from django.urls import path
from studys.views import *

urlpatterns = [


    # 获取标签
    path('labels/', LabelView.as_view({'get':'label_desc','post':'add_label'})),
    path('label/<int:pk>/', LabelView.as_view({'put':'upd_label','delete':'del_label'})),

    # 分类管理
    path('classifys/', ClassifyView.as_view({'get':'classify_desc','post':'add_classify'})),
    path('classify/<int:pk>/', ClassifyView.as_view({'put':'upd_classify','delete':'del_classify'})),

    # 学习内容
    path('contents/', ContentsView.as_view({'get':'content_desc','post':'add_content'})),
    path('content/<int:pk>/', ContentsView.as_view({'put':'upd_content','delete':'del_content'})),

    # 发布任务
    path('tasks/', TaskView.as_view({'post':'publish_content','get':'content_desc'})),
    path('task/<int:pk>/', TaskView.as_view({'get':'desc_content'})),

    # 学习记录
    path('records/', RecordView.as_view({'get':'record_desc'})),
    path('record/', RecordView.as_view({'put':'upd_record'})),

    # 弹幕管理
    path('barrages/', BarrageView.as_view({'post':'add_barrage','get':'barrage_desc'})),

    # 学习资源管理
    path('resources/', ResourceView.as_view({'get':'list_resource','post':'add_resource'})),
    path('my_resource/', ResourceView.as_view({'get':'my_resource'})),
    path('resource/<int:pk>/', ResourceView.as_view({'put':'upd_resource','delete':'del_resource'})),

    # 订单管理
    path('orders/', OrderView.as_view({'get':'list_order','post':'add_order','put':'check_order'})),
    path('order/<int:pk>/', OrderView.as_view({'get':'order_get_details','delete':'order_del','put':'not_order_del'})),

    # 收藏管理
    path('collects/', CollectView.as_view({'get':'collect_list'})),
    path('collect/<int:pk>/', CollectView.as_view({'post':'add_collect','delete':'del_collect'})),
]